cmake_minimum_required(VERSION 3.5.0)

project(imgui)

file(GLOB imgui_src *.cpp)

if(IMGUI_PLATFORM_USE_ALLEGRO5)
set(platform_src 
    backends/imgui_impl_allegro5.cpp
)
endif()

if(IMGUI_PLATFORM_USE_ANDROID)
set(platform_src 
    backends/imgui_impl_android.cpp

)
endif()

if(IMGUI_PLATFORM_USE_GLFW)
set(platform_src 
    backends/imgui_impl_glfw.cpp
)
endif()


if(IMGUI_PLATFORM_USE_WIN32)
set(platform_src 
    backends/imgui_impl_win32.cpp

)
endif()

if(IMGUI_PLATFORM_USE_SDL2)

set(platform_src 
    backends/imgui_impl_sdl2.cpp
)
endif()

if(IMGUI_PLATFORM_USE_SDL3)

set(platform_src 
    backends/imgui_impl_sdl3.cpp
)
endif()

if(IMGUI_PLATFORM_USE_SDLRENDER2)
set(platform_src 
    backends/imgui_impl_sdlrenderer2.cpp
)
endif()

if(IMGUI_PLATFORM_USE_SDLRENDER3)
set(platform_src 
    backends/imgui_impl_sdlrenderer3.cpp
)
endif()

if(IMGUI_PLATFORM_USE_GLUT)
set(platform_src 
    backends/imgui_impl_glut.cpp
)
endif()

if(IMGUI_GRAPH_USE_OPENGL2)
set(graph_src 
    backends/imgui_impl_opengl2.cpp
)
endif()

if(IMGUI_GRAPH_USE_OPENGL3)
set(graph_src 
    backends/imgui_impl_opengl3.cpp
)
endif()

if(IMGUI_GRAPH_USE_DX9)
set(graph_src 
    backends/imgui_impl_dx9.cpp
)
endif()

if(IMGUI_GRAPH_USE_DX10)
set(graph_src 
    backends/imgui_impl_dx9.cpp
)
endif()

if(IMGUI_GRAPH_USE_DX11)
set(graph_src 
    backends/imgui_impl_dx11.cpp
)
endif()

if(IMGUI_GRAPH_USE_DX12)
set(graph_src 
    backends/imgui_impl_dx12.cpp
)
endif()


if(IMGUI_GRAPH_USE_VULKAN)
set(graph_src 
    backends/imgui_impl_vulkan.cpp
)
endif()

if(IMGUI_GRAPH_USE_WGPU)
set(graph_src 
    backends/imgui_impl_wgpu.cpp
)
endif()

add_library(imgui ${imgui_src} ${platform_src} ${graph_src})
